<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
	    <base href="<%=basePath%>">
		<title>设置图文素材</title>
        <%@include file="../collect/meta.jsp"%>
		<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
		<link rel="stylesheet" href="css/table.css" type="text/css"></link>
		<link rel="stylesheet" href="css/btn-bottom.css" type="text/css"></link>
		<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
    </head>
	<body lang="zh-cn">
	<div class="wrapper">	
       <c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>微信管理</li>
							<li>自动回复管理</li>
							<li><a href="wxReplyItem!watchReplyItem">设置图文素材</a></li>
						</ul>
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<div class="alert alert-success">
									图文素材有两种关联方式。第一种是关键字回复，可以在【设置问题】功能中选择图文类型回复；
									第二种是菜单按钮回复，在【菜单管理】功能中的“触发方式”一栏里选择“发送消息”，
									就可以在“消息关键词”中选择图文回复。
								</div>
								<a class="btn btn-primary radius" id="btn-bottom" href="${ctx}/account/account_texture_add.jsp">新建图文素材</a>
								<table class="table table-striped table-bordered table-hover">
									 <tr>
									   <th>标题</th>
									   <th>类型</th>
									   <th>创建时间</th>
									   <th>操作</th>
									 </tr>
									 <c:forEach items="${replys}" var="reply" varStatus="status">
										 <tr>
										   <td><div align="center">${reply.title }</div></td>
										   <td>
										   		<c:choose>
										   			<c:when test="${reply.type == 1 }">
										   				文本
										   			</c:when>
										   			<c:when test="${reply.type == 2 }">
										   				链接
										   			</c:when>
										   			<c:when test="${reply.type == 3 }">
										   				图文
										   			</c:when>
										   			<c:otherwise>
										   				关注时回复
										   			</c:otherwise>
										   		</c:choose>
										   </td>
										   <td>${reply.createTime }</td>
										   <td>
										   			<a class="btn btn-xs btn-primary radius" href="wxReplyItem!selectReplyAndWxReplyItem?reply.id=${reply.id}" >修改</a>
										   			<a id="del" class="btn btn-xs btn-primary radius" href="wxReplyItem!delReplyItem?reply.id=${reply.id }">删除</a>
										   </td>
										 </tr>
									 </c:forEach>
								</table>			
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse" style="position:fixed;bottom:0;">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<div class="push"></div>
     </div>
     <c:import url="/collect/down.jsp"></c:import>
     <!-- 弹出框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content radius">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               操作提示
            </h4>
         </div>
         <div class="modal-body">
                <p>删除此条回复，会删除与之关联的关键字信息。确定要删除吗？</p>
         </div>
         <div class="modal-footer radius">
            <a id="confirm" class="btn btn-primary btn-sm radius">确定</a>
            <button type="button" class="btn btn-sm btn-default radius" 
               data-dismiss="modal">取消
            </button>
         </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
      <script type="text/javascript">
	    //防dropmenu刷新收回;$设置图文素材
		$(document).ready(function(){
				$('.weixinguanli > ul').show();
				$('.autoanswer > ul').show();
				$('.autoanswer > ul > li > a').eq(3).css("color","red");
			});
		//提示框中确定按钮绑定删除事件
$(function(){
    $("a#del").click(function(){
        var href = $(this).attr("href");
        $("#myModal").modal('show');
        $("a#confirm").attr("href",href);
        return false;
    }); 
});
	    </script>
  </body>
</html>
